package android.support.v4.app;

import android.os.Bundle;
import android.support.v4.a.b;
import android.util.Log;
import java.io.PrintWriter;

final class x
  implements b
{
  final int a;
  final Bundle b;
  v c;
  android.support.v4.a.a d;
  boolean e;
  boolean f;
  Object g;
  boolean h;
  boolean i;
  boolean j;
  boolean k;
  boolean l;
  boolean m;
  x n;

  final void a()
  {
    if (w.a)
      Log.v("LoaderManager", "  Stopping: " + this);
    this.h = false;
    if ((this.i) || (this.d == null) || (!(this.m)))
      return;
    this.m = false;
    this.d.a(this);
    this.d.b();
  }

  final void a(android.support.v4.a.a parama, Object paramObject)
  {
    String str;
    if (this.c != null)
    {
      if (this.o.e == null)
        break label171;
      str = this.o.e.b.u;
      this.o.e.b.u = "onLoadFinished";
    }
    while (true)
    {
      try
      {
        if (w.a)
        {
          parama = new StringBuilder("  onLoadFinished in ").append(parama).append(": ");
          StringBuilder localStringBuilder = new StringBuilder(64);
          android.support.v4.c.a.a(paramObject, localStringBuilder);
          localStringBuilder.append("}");
          Log.v("LoaderManager", localStringBuilder.toString());
        }
        if (this.o.e != null);
        return;
      }
      finally
      {
        if (this.o.e != null)
          this.o.e.b.u = str;
      }
      label171: str = null;
    }
  }

  public final void a(String paramString, PrintWriter paramPrintWriter)
  {
    String str = paramString;
    paramString = this;
    while (true)
    {
      paramPrintWriter.print(str);
      paramPrintWriter.print("mId=");
      paramPrintWriter.print(paramString.a);
      paramPrintWriter.print(" mArgs=");
      paramPrintWriter.println(paramString.b);
      paramPrintWriter.print(str);
      paramPrintWriter.print("mCallbacks=");
      paramPrintWriter.println(paramString.c);
      paramPrintWriter.print(str);
      paramPrintWriter.print("mLoader=");
      paramPrintWriter.println(paramString.d);
      if (paramString.d != null)
        paramString.d.a(str + "  ", paramPrintWriter);
      if ((paramString.e) || (paramString.f))
      {
        paramPrintWriter.print(str);
        paramPrintWriter.print("mHaveData=");
        paramPrintWriter.print(paramString.e);
        paramPrintWriter.print("  mDeliveredData=");
        paramPrintWriter.println(paramString.f);
        paramPrintWriter.print(str);
        paramPrintWriter.print("mData=");
        paramPrintWriter.println(paramString.g);
      }
      paramPrintWriter.print(str);
      paramPrintWriter.print("mStarted=");
      paramPrintWriter.print(paramString.h);
      paramPrintWriter.print(" mReportNextStart=");
      paramPrintWriter.print(paramString.k);
      paramPrintWriter.print(" mDestroyed=");
      paramPrintWriter.println(paramString.l);
      paramPrintWriter.print(str);
      paramPrintWriter.print("mRetaining=");
      paramPrintWriter.print(paramString.i);
      paramPrintWriter.print(" mRetainingStarted=");
      paramPrintWriter.print(paramString.j);
      paramPrintWriter.print(" mListenerRegistered=");
      paramPrintWriter.println(paramString.m);
      if (paramString.n == null)
        return;
      paramPrintWriter.print(str);
      paramPrintWriter.println("Pending Loader ");
      paramPrintWriter.print(paramString.n);
      paramPrintWriter.println(":");
      paramString = paramString.n;
      str = str + "  ";
    }
  }

  final void b()
  {
    String str;
    x localx = this;
    if (w.a)
      Log.v("LoaderManager", "  Destroying: " + localx);
    localx.l = true;
    boolean bool = localx.f;
    localx.f = false;
    if ((localx.c != null) && (localx.d != null) && (localx.e) && (bool))
    {
      if (w.a)
        Log.v("LoaderManager", "  Reseting: " + localx);
      if (localx.o.e == null)
        break label226;
      str = localx.o.e.b.u;
      localx.o.e.b.u = "onLoaderReset";
    }
    while (true)
    {
      while (true)
      {
        if (localx.o.e != null)
          localx.o.e.b.u = str;
        localx.c = null;
        localx.g = null;
        localx.e = false;
        if (localx.d != null)
        {
          if (localx.m)
          {
            localx.m = false;
            localx.d.a(localx);
          }
          localx.d.c();
        }
        if (localx.n == null)
          break;
        localx = localx.n;
      }
      return;
      label226: str = null;
    }
  }

  public final String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder(64);
    localStringBuilder.append("LoaderInfo{");
    localStringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
    localStringBuilder.append(" #");
    localStringBuilder.append(this.a);
    localStringBuilder.append(" : ");
    android.support.v4.c.a.a(this.d, localStringBuilder);
    localStringBuilder.append("}}");
    return localStringBuilder.toString();
  }
}